home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 301-325 / 325 / rexxhostlib / libstartup.asm < prev    next >
Assembly Source File  |  1995-03-14  |  2KB  |  123 lines

  1. ****************************************************************************
  2. *
  3. *    This Amiga shared library is based on example source code
  4. *    written by Gary Samad & Bill Hawes. It also employs basic
  5. *    library concepts introduced by Jimm Mackraz (ELib) and
  6. *    Edwin Hoogerbeets (MkLib). This library was generated using
  7. *    a customized version of the MkLib utility.
  8. *
  9. ****************************************************************************
  10. *
  11. *    Initial startup routine for Aztec C.
  12. *    Copyright (C) 1986 by Manx Software Systems, Inc.
  13. *
  14. *    But FUNKIFIED by Jimm Mackraz.
  15. *
  16. *    library base    in D0
  17. *    segment list    in A0
  18. *    execbase    in A6
  19. *
  20. *    NOTE: code down to "start" must be placed at beginning of
  21. *          all programs linked with Aztec Linker using small
  22. *          code or small data.
  23. *
  24. ****************************************************************************
  25.  
  26.     INCLUDE    'exec/types.i'
  27.     INCLUDE    'exec/nodes.i'
  28.     INCLUDE    'exec/resident.i'
  29.     INCLUDE    'exec/libraries.i'
  30.  
  31. a4save
  32.     DC.L    0
  33.  
  34.     PUBLIC    .begin
  35. .begin
  36.         PUBLIC    _LibInit
  37.  
  38. _LibInit:
  39.  
  40.     NEAR    CODE
  41.  
  42.     MOVEM.L    D0/D2/D3/D4-D7/A2-A6,-(SP)
  43.  
  44.     MOVE.L    A0,A4
  45.     ADD.L    A4,A4
  46.     ADD.L    A4,A4
  47.  
  48.     MOVE.L    (A4),A4
  49.     ADD.L    A4,A4
  50.     ADD.L    A4,A4
  51.  
  52.     ADD.L    #32766+4,A4
  53.     LEA    __H1_end,A1
  54.     LEA    __H2_org,A2
  55.     CMP.L    A1,A2
  56.     BNE    start
  57.     MOVE.W    #((__H2_end-__H2_org)/4)-1,D1
  58.     BMI    start
  59.     MOVE.L    #0,D2
  60. loop
  61.     MOVE.L    D2,(A1)+
  62.     DBRA    D1,loop
  63.  
  64. start
  65.     LEA    a4save,A1
  66.     MOVE.L    A4,(A1)
  67.     MOVE.L    A6,_SysBase
  68.  
  69.     MOVEM.L    D0/A0,-(SP)
  70.     JSR    _LibMain
  71.     ADDQ.L    #8,SP
  72.  
  73.     MOVEM.L    (SP)+,D0/D2/D3/D4-D7/A2-A6
  74.     RTS
  75.  
  76.     PUBLIC    _geta4
  77. _geta4:
  78.         MOVE.L    a4save,A4
  79.         RTS
  80.  
  81.         DSEG
  82.  
  83. _SysBase
  84.     DC.L    0
  85.  
  86.         PUBLIC  _LibMain
  87.         PUBLIC  _SysBase
  88.         PUBLIC  __H1_end,__H2_org,__H2_end
  89.  
  90. ****************************************************************************
  91. *
  92. *    This is the romtag structure for an Amiga Exec library.
  93. *
  94. ****************************************************************************
  95.  
  96.     CSEG
  97.  
  98. MYVERSION    EQU    1
  99. MYPRI        EQU    0
  100.  
  101.     PUBLIC    _LibName
  102.     PUBLIC    _LibId
  103.     PUBLIC    _LibInitTab
  104.  
  105.     DS    0
  106.     PUBLIC    _LibRomTag
  107.  
  108. _LibRomTag:
  109.  
  110.     DC.W    RTC_MATCHWORD
  111.     DC.L    _LibRomTag
  112.     DC.L    EndTag
  113.     DC.B    RTF_AUTOINIT
  114.     DC.B    MYVERSION
  115.     DC.B    NT_LIBRARY
  116.     DC.B    MYPRI
  117.     DC.L    _LibName
  118.     DC.L    _LibId
  119.     DC.L    _LibInitTab
  120.  
  121. EndTag:
  122.     END
  123.